// 系统常用脚本
if(!window.$)window.$ = function(id){return document.getElementById(id)}
if(!window._$)window._$ = function(id){return document.getElementById(id)} 
function chaCss(o,bg,bor){//input鼠标放上去显示方法
		o.style.borderColor = bg;
		o.style.backgroundColor = bor;
}
var caiying2007;
var bg_out="#cedbe3",border_out="#FFFFFF";//指向时样式颜色
var bg_over="#FF9900",border_over="#FFFFEC";//离开时样式颜色
function changbg(obj){
	if (!obj.cssColor)obj.cssColor=0
	if (obj.cssColor!=1){chaCss(obj,bg_over,border_over);}
	
	obj.onmouseout = function(){
		if (this.cssColor==0)
			chaCss(this,bg_out,border_out);
	}
	obj.onblur= function(){
		this.cssColor=0;
		chaCss(this,bg_out,border_out);
	}
	obj.onfocus= function(){
		if (caiying2007 && caiying2007!=this){caiying2007.cssColor=0;caiying2007=this}
		this.cssColor=1;
	}
}


function correctPNG(){/*IE5.5&6.0的alpha通道,png透明处理*/
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters)) 
    {
       for(var j=0; j<document.images.length; j++)
       {
          var img = document.images[j]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
          {
             var imgID = (img.id) ? "id='" + img.id + "' " : ""
             var imgClass = (img.className) ? "class='" + img.className + "' " : ""
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
             var imgStyle = "display:inline-block;" + img.style.cssText 
             if (img.align == "left") imgStyle = "float:left;" + imgStyle
             if (img.align == "right") imgStyle = "float:right;" + imgStyle
             if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
             var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
             img.outerHTML = strNewHTML
             j = j-1
          }
       }
    }    
}

function SetCwinHeight(o){//iframe自动高度方法
if (document.getElementById){
   if (o && !window.opera){
    if (o.contentDocument && o.contentDocument.body.offsetHeight){
     o.height = o.contentDocument.body.offsetHeight;
	 //o.width='100%';
    }else if(o.Document && o.Document.body.scrollHeight){
     o.height = o.Document.body.scrollHeight;
	 //o.width='100%';
    }
	//alert(o.Document.body.scrollHeight);
	//alert(o.width);
	//alert(parent.document.body.clientWidth-184);
   }
}
}


function treeView(){//左右显示掩藏方法
   scrollBy( -screen.width ,0 )
   switch(document.all('tree').style.display){
   case "block":
    document.all('tree').style.display='none';
    document.all('showhidebtn').src="images/line_rgt.gif"
    document.all('rgtcont').style.paddingLeft='0px';
    break;
   case "none":
    document.all('tree').style.display='block';
    document.all('showhidebtn').src="images/line_left.gif"
    document.all('rgtcont').style.paddingLeft='0px';
    break;
   }
}


function chgaClass(divid,aid){//获得标记为id的元素下的所有a标签的样式，并且更换样式。
var rootid = document.getElementById(divid);
try{
  var tag = rootid.getElementsByTagName("a"); 
  var len = tag.length;
  for(i=0;i<len;i++){
	  tag[i].className='';
	  }
	  aid.className='amenus';
	}
catch(e){ //处理异常的或者再次抛出  
 alert(e.name + ": " + e.message);
 throw e;   
      }   
	}

/*加载png透明函数*/
//window.attachEvent("onload", correctPNG);